#include<stdio.h>
int main()
{
int a = 0, b = 0, c = 0, k = 0, d = 0, f = 0, g = 0, h = 0, l = 0, u = 0, y = 0, p = 0, n = 0;
printf(“请输入一个正整数\n”);
scanf_s("%d", &a);
b = a % 7; d = a % 3;
k = a - 7; f = a - 3;
c = k >= 0 && b == 0; g = f >= 0 && d == 0;
h = c && g; l = c || g; u = (c == 1 && g == 0); y = a / 3; p = a / 7; n = a / 21;
if (l == 0) printf("%d既不是三的倍数也不是七的倍数\n", a);
else if (l != 0) {
switch (h) {
case 1: {printf("%d是三和七的倍数\n", a); printf("%d=%d×7或%d=%d×3", a,n3,a,n7);
}; break;
case 0: {switch (u) {
case 1:{printf("%d是七的倍数不是三的倍数\n", a); printf("%d=%d×7",a,p);
}; break;
case 0: {printf("%d是三的倍数不是七的倍数\n", a); printf("%d=%d×3", a,y);
}; break;
}
}; break;
default:printf("三天之内撒了你\n"); break;
}
}
return 0;
}